import sys
import libappend
from PIL import Image

PATH_FROM = "./from/texture/"
PATH_TO = "./to/texture/"

if len(sys.argv) > 0:
    tp_nam = sys.argv[1]
    scale = 0.5 if len(sys.argv) <= 2 else sys.argv[2]
    img = Image.open(PATH_FROM + tp_nam)
    tar = img.resize((int(img.size[0]*float(scale)), int(img.size[1]*float(scale))), Image.ANTIALIAS)
    tar.save(PATH_TO+tp_nam)
else:
    print("resize failed!")